In a device for measuring and inspecting a pattern formed on a semiconductor wafer, the template-matching technology is used in order to focus the microscope's field-of-view (: FOV) onto a desired measurement position. The template-matching technology is an image processing technology for finding out from inside a to-be-searched image, an area that coincides most with a template image registered in advance. The template-matching technology is known as a technique that is effective for searching for a microminiaturized pattern. The template-matching-used template image needs to be prepared in advance. In PATENT LITERATURES 1 and 2, the explanation has been given concerning a technique for creating the template image like this from the simulation image of design data (i.e., pattern's layout data). The layout data is data for indicating a pattern's ideal shape. Accordingly, there exists a gap in shape or the like between the layout data and a pattern that is actually formed via the semiconductor fabrication processes. As a result, in some cases, it becomes difficult to make the coincidence-degree judgment with a high accuracy. In PATENT LITERATURES 1 and 2, however, the template image is formed based on the simulation-applied design data. This condition makes it possible to suppress the shape difference between the template image and the target pattern on the to-be-searched image. As a consequence of this suppression, it becomes possible to enhance a success ratio of the matching.
Meanwhile, as disclosed in PATENT LITERATURE 3, dm explanation has been given regarding a technique for suppressing the shape difference between the layout data and the to-be-searched image by applying a smoothing processing to each of the layout data and the to-be-searched image.